package com.test.springCloud.service.impl;

import com.test.springCloud.mapper.MsgInfoMapper;
import com.test.springCloud.service.MsgInfoService;
import com.test.springcloud.pojo.MsgInfoPojo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("MsgInfoService")
public class MsgInfoServiceImpl implements MsgInfoService {

    @Resource
    MsgInfoMapper msgInfoMapper;
    
    public int insert(MsgInfoPojo msgInfo) {
        return msgInfoMapper.insertMsg(msgInfo);
    }

    public void msgRead(Integer fromUserId, Integer toUserId) {
        msgInfoMapper.msgRead(fromUserId,toUserId);
    }

    public List<MsgInfoPojo> selectMsgList(Integer fromUserId, Integer toUserId) {
        return msgInfoMapper.selectMsgList(fromUserId,toUserId);
    }
}
